package com.example.springioc3;

import com.example.springioc3.controller.UserController;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;

import java.beans.Introspector;

//@SpringBootApplication
//public class SpringIoC3Application {
//    public static void main(String[] args) {
//        //拿到Spring上下文
//        ApplicationContext context = SpringApplication.run(SpringIoC3Application.class, args);
//        //拿到Spring上下文对象
//        UserController userController = context.getBean(UserController.class);
//        //使用对象
//        userController.doController();
//    }
//}
@SpringBootApplication
public class SpringIoC3Application
{
    public static void main(String[] args) {
        //拿到Spring上下文
        ApplicationContext context = SpringApplication.run(SpringIoC3Application.class, args);
        //拿到Spring上下文对象
        UserController bean = context.getBean(UserController.class);
        //使用对象
        System.out.println(bean.toString());
//        System.out.println(Introspector.decapitalize("UserController"));
//        System.out.println(Introspector.decapitalize("UController"));
//        System.out.println(Introspector.decapitalize("UCOntroller"));
    }
}
